<template>
        <view class="usr-info">

            <view class="usr-group">
                  <view class="usr-head">
                      <image v-if="userData.userHeadportrait" :src="userData.userHeadportrait" />
                      <image v-else src="/static/images/blank.png" />
                  </view>  
                  <view class="usr-ul">
                      <view v-if="userData.userName">{{ userData.userName }}</view>
                      <view v-else @tap="login">注册/登录 </view>
                      <view class="level" v-if="userData.userLevelName">{{userData.userLevelName}}</view>

                 </view> 

                 <image :src="require('../_static/images/qrcode.png')" 
                        class="usr-qrcode"
                        @tap="toRqCode" 
                        v-if="nickName" />
                
            </view>

            <view class="usr-btm" @tap="toDetail" >
                <view class="usr-btm-news">{{artData.articleTitle}}</view>
          
                <view class="usr-btm-more" v-if="artData.articleTitle">
                      <view class="t">立即查看</view>  
                      <image :src="require('../_static/images/personal_btn.jpg')" />
                </view>
            </view>
            <image :src="require('../_static/images/personal_bg.jpg')" />
        </view>
</template>
<script>




export default {
  
    props:{
         d:{
            type:Object,
            default:{}
        },
        art:{
            type:Object,
            default:{}
        }
    },
    data(){
        return{
            nickName:'',
            avatarUrl:'',
            tel:'',
            level:''
        }
       
    },
    computed:{
        userData(){
           
            return this.d;
        },
        artData(){
            return this.art;
        }
    },

    methods:{
           
            login(){

           
                  uni.navigateTo({
                              url: `/pages/login/index`
                          });
            },
            toDetail(){
                let {id} = this.art;
                 uni.navigateTo({
                        url:`/detailPackages/pages/findDetail/index?id=${id}`
                })
            },
            toRqCode(){
                uni.navigateTo({
                    url:'/subPackages/pages/qrcode/index'
                })
            }
    }
  
}

</script>
<style lang="scss">
  
</style>